﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShoppingCarts.aspx.cs" Inherits="Home_ShoppingCarts" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>我的购物车</title>
    <link href="/css/base.css" rel="stylesheet" type="text/css" />
    <link href="/css/home.css" rel="stylesheet" type="text/css" />
    <!--#include file="~/Public/commonjs.shtml" -->
    <script type="text/javascript" src="/Home/Js/ShoppingCarts.js"></script>
    <script type="text/javascript">
        BackUrl = '<%=backUrl %>';
        Total = <%=listOfCarts!=null? listOfCarts.Count:0 %>;
    </script>
</head>
<body>

     <!--#include file="~/Public/top.shtml" -->
     
     <!--main开始-->
     <div class="main w960 cb pr">
        <!--#include file="/Public/onlineqq.shtml" -->
       <div class="block1 mt10">
         <!--left-->
         <div class="m_left">
<div class="cb mb10">
<div class="left_bar_hot"></div>
           <div class="left_hot">
             <div class="white_bg">
              <!--#include file="~/AutoGenerate/list-hotgoods-words.shtml" -->
             </div>
             
             <div class="left_hot_list">
              <!--#include file="~/AutoGenerate/list-hotgoods-pic.shtml" -->
             </div>
           </div>
           
           <div class="left_bar_bottom"></div>
           </div>
         </div>
         <!--left end-->
         <!--right-->
         <div class="m_right ft">
            <p class="tar">
              当前位置： <a href="/index.aspx">首页</a> > 我的购物车
            </p>
 

 			 <div class="area">
               <div class="area_top"></div>
               <div class="area_main">
                  <div class="my_path cb">
                  <p class="my_carON">我的购物车</p>
                  <p class="space_ico"></p>
                  <p class="my_info">填写核对订单信息</p>
                  <p class="space_ico"></p>
                  <p class="my_succes">成功提交订单</p>
                 </div>


               <table width="100%" border="0" cellspacing="0" cellpadding="0" class="my_shop cb">
                  <tr class="list_bg6">
                  <th height="5" width="120"></th>
                  <th width="100">&nbsp;</th>
                  <th colspan="2" align="left" width="240" class="pl10">&nbsp;</th>
                  <th width="80">&nbsp;</th>
                  <th width="80">&nbsp;</th>
                  <th width="80">&nbsp;</th>
                  <th width="80">&nbsp;</th>
                  </tr>
                  <tr class="list_bg5">
                  <th height="38" width="120" style="background-image:none;">商品编号</th>
                  <th width="100">图片</th>
                  <th colspan="2" align="left" width="240" class="pl10">商品名称</th>
                  <th width="80">赠送积分</th>
                  <th width="80">点客价</th>
                  <th width="80">订单数量</th>
                  <th width="80">操作</th>
                  </tr>

                  
                  <%
                      if (listOfCarts != null)
                      {
                          for (int i = 0; i < listOfCarts.Count; ++i)
                          {
                              ShoppingCartInfo l = listOfCarts[i];
                              totalQuantity += l.CartInfo.Quantity;
                              totalMoney += (l.CartInfo.Price * l.CartInfo.Quantity);
                            
                  %>

                  <tr>
                  <td align="center" class="pl5"><%=l.CartInfo.GoodsID %></td>
                  <td align="center"><a href="/Goods/<%=l.CartInfo.GoodsID %>.html" target="_blank" title="<%=l.GoodsName %>"><img src="<%=l.SuperSmallPicture %>" /></a></td>
                  <td colspan="2" align="left" class="pl10"><a href="/Goods/<%=l.CartInfo.GoodsID %>.html" target="_blank" title="<%=l.GoodsName %>"><%=l.GoodsName %></a></td>
                 <td align="center"><%=l.CartInfo.PresentScores %>分</td>
                  <td align="center" class="red_bold"><%=Utility.FormatMoneyStr(l.CartInfo.Price) %>元</td>
                  <td align="center">
                  <input name="hfCartID<%=i %>" type="hidden" id="hfCartID<%=i %>" value="<%=l.CartInfo.ShoppingCartID %>" /> 
                  <input name="hfPrice<%=i %>" type="hidden" id="hfPrice<%=i %>" value="<%=l.CartInfo.Price %>" /> 
                  <a href="javascript:void(0);" onclick="SubCartNum(<%=i %>);">-</a> <input type="text" id="txtQuantity<%=i %>" class="w40" value="<%=l.CartInfo.Quantity %>" onchange="ModifyQuantity(<%=i %>);" /> <a href="javascript:void(0);" onclick="AddCartNum(<%=i %>);">+</a>
                  
                  </td>
                  <td align="center"><a href="javascript:DeleteCart(<%=l.CartInfo.ShoppingCartID %>);" class="blue3">删除</a><br/><a href="/Goods/<%=l.CartInfo.GoodsID %>.html" target="_blank" class="blue3">查看</a></td>
                  </tr>
                  <%}
                      }
                      else
                      { %>

      			 <tr>
                 
                  <td  colspan="8" align="center" class="pl10">[ 购物车内暂时没有商品，您可以去首页挑选喜欢的商品!  <a href="/" class="red">去首页</a> ]</td>
                
                  </tr>
                  <%} %>

              </table>
              <%
                  if (listOfCarts != null)
                  { %>
              <div class="list_bg5 tar hui3 f14 pr20">
                共采购商品 <span id="spTotalQuantity" class="red fb"><%=totalQuantity %></span> 件，总金额￥<span id="spTotalMoney" class="red_400 fb"><%=Utility.FormatMoneyStr(totalMoney) %></span>
              </div>
              
              <div class="btn_shop">
                <input type="button" value="" class="btn_shop3" onclick="location.href='/Home/ConfirmOrder.aspx';" /> 
                <input type="button" value="" class="btn_shop2" onclick="GoToBuy();" />
                <input type="button" value="" class="btn_shop1" onclick="ClearCarts();"/>
              </div>
              <%} %>
               
    </div>
              <div class="area_bottom"></div>
            
            </div>
            <!--分页-->
            <!--<div class="food_x">
              <p class="cb page_number">
                 <a href="#" class="w70">上一页</a>
                 <a href="#" >1</a>
                 <a href="#">2</a>
                 <a href="#">3</a>
                 <a href="#">4</a>
                 <a href="#" class="on_page">5</a>
                 <a href="#">6</a>
                 <a href="#">7</a>
                 <a href="#" class="w70">上一页</a>
                       
               </p>
           </div>-->
       </div>
         </div> 
         <!--right end-->
       </div>
        
     <!--new product-->
     <!--new product end-->
         <!--六个块-->
         <!--休闲食品-->
         <!---块结束-->
        
         
     </div>
    
    
     <div class="share cb w960">
        <div>
           <!--#include file="~/AutoGenerate/AllPage-Bottom-Banner.htm" -->
        </div>
          <!--#include file="~/Public/bottom-shopHelper.shtml" -->
     </div>
    

    <!--#include file="~/Public/bottom.shtml" -->

</body>
</html>
